import java.util.Scanner;

/**
 * @author gao
 * @date 2025/8/7 22:07
 */

public class Main {
    public static boolean isSquare(int n) {
        return Math.sqrt(n) % 1 == 0;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int ret = 0;
            int[] nums = new int[n];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = in.nextInt();
                if (!isSquare(nums[i])) {
                    ret = Math.max(ret, nums[i]);
                }
            }
            System.out.println(ret);
        }
    }
}